package cn.com.ustudy.course.study.model.entity;

import cn.com.ustudy.course.core.model.entity.Course;
import cn.melonlib.cores.commons.model.entity.TenantRecordEntity;
import cn.melonlib.cores.model.anno.ModelComment;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

@Data
@EqualsAndHashCode(callSuper = true)
@Entity(name = "CourseStudent")
@Table(name = "crs_study_course_student")
@ModelComment("加入课程学习的学生")
public class CourseStudent extends TenantRecordEntity {

    @ManyToOne(cascade = CascadeType.REFRESH,fetch = FetchType.LAZY)
    @JoinColumn(name = "course_id")
    @ModelComment("所属课程")
    private Course course;

    @ModelComment("学习课程的学生")
    private String student;
}
